package gov.nasa.anml;

import java.util.ArrayList;

import gov.nasa.anml.lifted.*;
import gov.nasa.anml.utility.*;

public class Context {
	// Action a;
	public SimpleFloat start;
	public SimpleFloat end; // absolute deadline for global states (more useful for local states)
	public int bra;
	public int ket;
	
	public Context outer; // lexically enclosing context
	
	public History<?> resolveFluent(int id) {
		if (outer != null)
			return outer.resolveFluent(id);
		return null;
	}

	public BindingHistoryMap<?> resolveFunction(int id) {
		if (outer != null)
			return outer.resolveFunction(id);
		return null;
	}

	public History<? extends SimpleObject<?>> addFluent(int id) {
		return outer.addFluent(id);
	}

	public <T extends SimpleObject<? super T>> BindingHistoryMap<T> makeFunction(FluentFunction<T> f) {
		return outer.makeFunction(f);
	}

	public ArrayList<Statement> beforeStart;
	public ArrayList<Statement> atStart;
	public ArrayList<Statement> afterStart;
	public ArrayList<Statement> beforeEnd;
	public ArrayList<Statement> atEnd;
	public ArrayList<Statement> afterEnd;
}

